<template>
  <div id="user">
    <!-- <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>登录中心</el-breadcrumb-item>
    </el-breadcrumb> -->
    <h2>登录中心</h2>
    <input type="text" v-model="username"/>
    <button @click="login">登录</button>
  </div>
</template>
 
<script>

import store from '@/store/index'
import {login} from "@/api/index"
export default {
  name: 'Login',
  data(){
    return{
        username:""
    }
  },
    methods:{
      login:function(){
        this.$store.commit('LOGIN_IN',this.username);
        login(this.username);
      }
    },
  store
}
</script>